package com.myz.rabbitmq.consumer;

import com.myz.rabbitmq.config.ConfirmConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

// 报警消费者
@Slf4j
@Component
public class WarningConsumer {
    // 接受报警消息
    @RabbitListener(queues = ConfirmConfig.WARNING_QUEUE)
    public void receiveWarning(Message message){
        String msg = new String(message.getBody());
        log.error("警告发现不可路由消息:{}",msg);
    }
}
